package com.hcbd.tdwt.ui.xingyu.activity;
import android.annotation.SuppressLint;
import android.widget.RadioButton;


import com.hcbd.tdwt.R;
import com.hcbd.tdwt.base.BaseActivity;
import com.hcbd.tdwt.ui.xingyu.fragment.AppReportPeaceFragment_;
import com.hcbd.tdwt.ui.xingyu.fragment.DeviceReportPeaceFragment_;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.CheckedChange;
import org.androidannotations.annotations.Click;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.ViewById;

@SuppressLint("NonConstantResourceId")
@EActivity(R.layout.activity_report_peace)
public class ReportPeaceActivity extends BaseActivity {
    @ViewById(R.id.device_report_peace)
    RadioButton deviceReportPeace;
    @ViewById(R.id.app_report_peace)
    RadioButton appReportPeace;
    AppReportPeaceFragment_ appReportPeaceFragment_;
    DeviceReportPeaceFragment_ deviceReportPeaceFragment_;
    @AfterViews
    protected void init() {
        appReportPeaceFragment_=new  AppReportPeaceFragment_();
        deviceReportPeaceFragment_=new DeviceReportPeaceFragment_();
        appReportPeace.setChecked(true);
    }

    @Click
    void headLeft(){
        finish();
    }


    @CheckedChange
    void deviceReportPeace(RadioButton radioButton,boolean isChecked){
        if(isChecked) {
            switchFragment(deviceReportPeaceFragment_, R.id.resultLL);
        }
    }

    @CheckedChange
    void appReportPeace(RadioButton radioButton,boolean isChecked){
        if(isChecked) {
            switchFragment(appReportPeaceFragment_, R.id.resultLL);
        }
    }


}
